﻿//页面加载
$(document).ready(function () {
    $("#btnSave").bind("click", btnSave_click);
    $("#btnCancel").bind("click", btnCancel_click);
    $("#btnAddRemark").bind("click", btnAddRemark_click);
    
   
})

function btnCancel_click() {
    window.history.go(-1);
}

function btnSave_click() {

    if ($("#status").val() == "0") {
        alert("当前订单已结单!");
        return;
    }

    var v_ID = $("#hdAID").val();
    $.post("/Order/ConfirmPayed", { orderCode: v_ID }, function (result) {
        if (result.code == "OK") {
            alert(result.msg);
            window.location.href = "/Order/Index";
        }
        else {
            alert(result.msg);
        }
    });
}

function btnAddRemark_click()
{
    var v_ID = $("#hdAID").val();
    var v_remark = $("#Buyer_Note").val();
    $.post("/Order/EditRemark", { id: v_ID, remark: v_remark }, function (result) {
        if (result.code == "OK") {
            alert(result.msg);
        }
        else {
            alert(result.msg);
        }
    });
}